<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="jwr" uri="http://jawr.net/tags" %>

<jwr:script src="/bundles/jsrender.js"/>
<div class="newsframe"></div>

<script id="userReviewsTemplate" type="text/x-jsrender">
    <div class="resnews">
        <ul class="replies">
            <li class="bg-color-{{>key.jobCategory.color}}" style="width: 100%">
                <div class="avatar"><img /></div>
                <div class="reply">
                    <div class="date">{{>value.lastModified}}</div>
                    <div class="author"><a href="#">{{>value.reviewer.name}}</a></div>
                    <div class="karma">{{>key.karma}}</div>
                    <div class="text">{{>value.content}}</div>
                    <div class="establishment"><a href="#">{{>key.place.name}}</a></div>
                </div>
            </li>
        </ul>
    </div>

    {{if #index%2 }}
    <div class="clearfix"></div>
    {{/if}}
</script>

<script type="text/javascript">
    $( document).ready( function() {
        $.ajax({
          url:"<c:url value='/reviews/top/users.do'/>",
          type: 'GET',
          cache: true,
          data: {job:0},
          dataType:"json"
        }).done( function(data) {
          $( ".newsframe" ).html(
            $( "#userReviewsTemplate" ).render( data )
          );
        });
    });
</script>
